#include "ThreadPool.hpp"
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
    // ThreadPool<Task> *tp = new ThreadPool<Task>(5);
    cout << "process is run" << endl;
    sleep(3);
    srand(time(NULL));
    ThreadPool<Task>::GetInterface()->Start();
    while (true)
    {

        int data1 = rand() % 10 + 1;
        int data2 = rand() % 5;
        char op = opnums[rand() % opnums.size()];
        Task t(data1, data2, op);
        ThreadPool<Task>::GetInterface()->push(t);
        // 2. 交给线程池处理
        std::cout << "main thread make task: " << t.GetTask() << std::endl;
        sleep(1);
    }

    return 0;
}